package cn.com.lyj6851.modules.product.service.mapper;

import cn.com.lyj6851.common.mapper.CoreMapper;
import cn.com.lyj6851.modules.product.domain.YdyStoreProductRelation;
import cn.com.lyj6851.modules.product.vo.YdyStoreProductRelationQueryVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
/**
 * <p>
 * 商品点赞和收藏表 Mapper 接口
 * </p>
 *
 */
public interface YdyStoreProductRelationMapper extends CoreMapper<YdyStoreProductRelation> {

    @Select("select B.id pid,A.type as category,B.store_name as storeName,B.price," +
            "B.ot_price as otPrice,B.sales,B.image,B.is_show as isShow" +
            " from ydy_store_product_relation A left join ydy_store_product B " +
            "on A.product_id = B.id where A.type=#{type} and A.uid=#{uid} and A.is_del = 0 and B.is_del = 0 order by A.create_time desc")
    List<YdyStoreProductRelationQueryVo> selectRelationList(Page page, @Param("uid") Long uid, @Param("type") String type);


}